package com.mifengkong.cygshare;

import com.mifengkong.cygshare.constant.ServletAddressConstant;
import com.mifengkong.frtools.app.FRApplication;
import com.mifengkong.frtools.app.FRServletAddress;
import com.mifengkong.frtools.http.request.cloudapi.FRCloudAPIUtil;
import com.mifengkong.frtools.util.FRDebugMode;

/**
 * Created by jack on 2018/1/16
 */

public class APP extends FRApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        FRDebugMode.setDebugMode(true);

        FRServletAddress.getInstance()
                .setOnlineServletAddress(ServletAddressConstant.SU_DAI, getString(R.string.sudai_online_address))
                .setReleaseServletAddress(ServletAddressConstant.SU_DAI, getString(R.string.sudai_release_address))
                .setOfflineServletAddress(ServletAddressConstant.SU_DAI, getString(R.string.sudai_offline_address))

                .setOnlineServletAddress(ServletAddressConstant.KA_MAO, getString(R.string.kamao_online_address))
                .setReleaseServletAddress(ServletAddressConstant.KA_MAO, getString(R.string.kamao_release_address))
                .setOfflineServletAddress(ServletAddressConstant.KA_MAO, getString(R.string.kamao_offline_address))

                .setOnlineServletAddress(ServletAddressConstant.JIEBA_API, getString(R.string.jieba_api_online_address_release))
                .setReleaseServletAddress(ServletAddressConstant.JIEBA_API, getString(R.string.jieba_api_online_address_release))
                .setOfflineServletAddress(ServletAddressConstant.JIEBA_API, getString(R.string.jieba_api_offline_address))

                .setOnlineServletAddress(ServletAddressConstant.JI_JIAN_CREDIT, getString(R.string.jjcard_crddet_online_address))
                .setReleaseServletAddress(ServletAddressConstant.JI_JIAN_CREDIT, getString(R.string.jjcard_crddet_online_address_release))
                .setOfflineServletAddress(ServletAddressConstant.JI_JIAN_CREDIT, getString(R.string.jjcard_crddet_offline_address));

        FRCloudAPIUtil.getInstance()
                .setBaseUrl(ServletAddressConstant.SU_DAI, getString(R.string.sudai_cloud_base_url))
                .setAppKey(ServletAddressConstant.SU_DAI, getString(R.string.sudai_cloud_app_key))
                .setSecretKey(ServletAddressConstant.SU_DAI, getString(R.string.sudai_cloud_secret_key))

                .setBaseUrl(ServletAddressConstant.KA_MAO, getString(R.string.cash_advance_cloud_base_url))
                .setAppKey(ServletAddressConstant.KA_MAO, getString(R.string.cash_advance_cloud_app_key))
                .setSecretKey(ServletAddressConstant.KA_MAO, getString(R.string.cash_advance_cloud_secret_key))

                .setBaseUrl(ServletAddressConstant.JI_JIAN_CREDIT, getString(R.string.jjcard_crddet_cloud_base_url))
                .setAppKey(ServletAddressConstant.JI_JIAN_CREDIT, getString(R.string.jjcard_crddet_cloud_app_key))
                .setSecretKey(ServletAddressConstant.JI_JIAN_CREDIT, getString(R.string.jjcard_crddet_cloud_secret_key));

        FRDebugMode.setIsUseCloudAPiHost(true);
    }
}
